﻿using Mt.Site.Core.Organizations.UserCache.Models;
using Mt.Site.Core.WorkFlows.Process;
using Mt.Site.Core.WorkFlows.Process.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Mt.Site.Core.WorkFlows.Diy.Actions
{
    public class ActionBase : IAction
    {
        public virtual Task<string> DisplayName(IWorkFlowManager manager)
        {
            return Task.FromResult(UniqueName);
        }
        public virtual string UniqueName => throw new NotImplementedException();


        public virtual bool NeedUserListArg => false;

        public virtual bool NeedReply(IWorkFlowManager manager)
        {
            return false;
        }

        /// <inheritdoc/>
        public virtual string JsActionName => "";

        /// <inheritdoc/>
        public virtual string JsOnSuccessActionName => "";

        public virtual bool NeedCheckState => false;

        public virtual async Task<GetUserSelectionDataOutput> GetUserListAsync(IWorkFlowManager manager, Guid? nodeId, List<long> unitId)
        {
            await Task.FromResult(0);
            return null;
        }

        public virtual Task<bool> IsShowAsync(IWorkFlowManager manager)
        {
            throw new NotImplementedException();
        }

        public virtual Task OperateAsync(IWorkFlowManager manager, object args)
        {
            throw new NotImplementedException();
        }

        public virtual Task<StateWhenSubmit> CheckStateBeforeActionAsync(IWorkFlowManager workFlowManager, object param)
        {
            var a = new StateWhenSubmit();
            return Task.FromResult(a);
        }
    }
}
